package com.huixue.zdb.config;

import lombok.Data;
import lombok.Getter;

import java.util.ArrayList;

@Data
@Getter
public class PageResult<T> {        //通用分页
    public Long total;             //总条数
    public Long totalPage;         //总页数
    public ArrayList<T> items;          //当前也数据

    public PageResult(){

    }
    public PageResult(Long total, ArrayList<T> items){
        this.total = total;
        this.items = items;
    }

    public PageResult(Long total, Long totalPage, ArrayList<T> items){
        this.total = total;
        this.totalPage = totalPage;
        this.items = items;
    }

    @Override
    public String toString() {
        return "PageResult{" +
                "total=" + total +
                ", totalPage=" + totalPage +
                ", items=" + items +
                '}';
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Long totalPage) {
        this.totalPage = totalPage;
    }

    public ArrayList<T> getItems() {
        return items;
    }

    public void setItems(ArrayList<T> items) {
        this.items = items;
    }
}
